package com.ruoyi.base.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 商品对象 product
 * 
 * @author ruoyi
 * @date 2025-06-24
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Product extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private String id;

    /** 商品名 */
    @Excel(name = "商品名")
    private String name;

    /** 详情 */
    @Excel(name = "详情")
    private String description;

    /** 剩余数量 */
    @Excel(name = "剩余数量")
    private String stockQuantity;

    /** 已售数量 */
    @Excel(name = "已售数量")
    private String soldQuantity;

    /** 单价 */
    @Excel(name = "单价")
    private BigDecimal unitPrice;

    /** 优惠价格 */
    @Excel(name = "优惠价格")
    private BigDecimal discountPrice;

    /** 状态 */
    @Excel(name = "状态")
    private Long status;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    /** 上架时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "上架时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date listedAt;

    /** 下架时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下架时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date delistedAt;

    /** 是否删除（0-否，1-是） */
    private Integer isDeleted;

    /** 图片地址 */
    @Excel(name = "图片地址")
    private String imageUrl;

    /**
     * 忽略sql的拼写
     */
    @TableField(exist = false)
    private List<Object> image;

    public void setId(String id) 
    {
        this.id = id;
    }

    public String getId() 
    {
        return id;
    }

    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }

    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    public void setStockQuantity(String stockQuantity) 
    {
        this.stockQuantity = stockQuantity;
    }

    public String getStockQuantity() 
    {
        return stockQuantity;
    }

    public void setSoldQuantity(String soldQuantity) 
    {
        this.soldQuantity = soldQuantity;
    }

    public String getSoldQuantity() 
    {
        return soldQuantity;
    }

    public void setUnitPrice(BigDecimal unitPrice) 
    {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice() 
    {
        return unitPrice;
    }

    public void setDiscountPrice(BigDecimal discountPrice) 
    {
        this.discountPrice = discountPrice;
    }

    public BigDecimal getDiscountPrice() 
    {
        return discountPrice;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }

    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) 
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() 
    {
        return updatedAt;
    }

    public void setListedAt(Date listedAt) 
    {
        this.listedAt = listedAt;
    }

    public Date getListedAt() 
    {
        return listedAt;
    }

    public void setDelistedAt(Date delistedAt) 
    {
        this.delistedAt = delistedAt;
    }

    public Date getDelistedAt() 
    {
        return delistedAt;
    }

    public void setIsDeleted(Integer isDeleted) 
    {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted() 
    {
        return isDeleted;
    }

    public void setImageUrl(String imageUrl) 
    {
        this.imageUrl = imageUrl;
    }

    public String getImageUrl() 
    {
        return imageUrl;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("name", getName())
            .append("description", getDescription())
            .append("stockQuantity", getStockQuantity())
            .append("soldQuantity", getSoldQuantity())
            .append("unitPrice", getUnitPrice())
            .append("discountPrice", getDiscountPrice())
            .append("status", getStatus())
            .append("createdAt", getCreatedAt())
            .append("updatedAt", getUpdatedAt())
            .append("listedAt", getListedAt())
            .append("delistedAt", getDelistedAt())
            .append("isDeleted", getIsDeleted())
            .append("imageUrl", getImageUrl())
            .toString();
    }
}
